# Contributor: Sean E. Russell <ser@ser1.net>
# Maintainer: Sean E. Russell <ser@ser1.net>
pkgname=legume
pkgver=1.4.2
pkgrel=1
pkgdesc="A distributed issue tracker base on developer code comments such as TODO and FIXME."
url="https://sr.ht/~ser/legume"
arch="all"
license="MIT"
makedepends="go"
subpackages="$pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://hg.sr.ht/~ser/legume/archive/v$pkgver.tar.gz"
builddir="$srcdir/$pkgname-v$pkgver"

build() {
	go build -ldflags "-X main.Version=v$pkgver" -v -o leg ./cmd/leg
}

check() {
	[ "$(./leg -V)" = "legume v$pkgver" ]

	go test ./cmd/leg ./fs ./parse ./stream
}

package() {
	install -Dm755 leg         "$pkgdir"/usr/bin/leg
	install -Dm644 leg.1       "$pkgdir"/usr/share/man/man1/leg.1
	install -Dm644 LICENSE     "$pkgdir"/usr/share/licenses/"$pkgname"/LICENSE
	install -Dm644 README.md   "$pkgdir"/usr/share/doc/"$pkgname"/README.md
}

sha512sums="
460cab3111243ea1b6eb5c42bdb5d32488fb60dee7a13e8bc2b6007ff3b1718062c53cce4810b897f1c32e51bd807241c81741ec10e5ae1faa530faf1346435b  legume-1.4.2.tar.gz
"
